<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>编辑器demo</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/static/css/oksub.css">
</head>
<body>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
      <legend>Layui编辑器演示</legend>
    </fieldset>

    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">文章内容</label>
            <div class="layui-input-block">
                <textarea name="describe" rows="20" class="layui-textarea editor" placeholder="请输入描述"></textarea>
            </div>
        </div>
    </form>

    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script src="/static/lib/ckeditor4/ckeditor.js" charset="utf-8"></script>
	<script type="text/javascript">
        layui.use(["layedit"], function () {
        	var $ = layui.jquery;
            var editorList = document.querySelectorAll(".editor");
            if (editorList.length > 0) {
                $.each(editorList, function (i, v) {
                    CKEDITOR.replace(
                        $(this).attr("name"),
                        {
                            height: $(this).height(),
                            filebrowserImageUploadUrl: '{:url("admin/upload/uploadEditor")}',
                      });
                });
            }
    	});
        
    </script>
</body>
</html>